package cn.thoughtworks.school.programCenter.repositories;

import cn.thoughtworks.school.programCenter.entities.UserAssignmentQuizTag;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface UserAssignmentQuizTagRepository extends JpaRepository<UserAssignmentQuizTag, Long> {
    List<UserAssignmentQuizTag> findByAssignmentIdAndStudentIdAndOperatorId(Long assignmentId, Long studentId, Long id);

    List<UserAssignmentQuizTag> findByAssignmentIdAndQuizIdAndStudentIdAndOperatorId(Long assignmentId, Long quizId, Long studentId, Long id);

    void deleteByOperatorIdAndStudentIdAndAssignmentId(Long userId, Long studentId, Long id);

    void deleteByOperatorIdAndStudentIdAndAssignmentIdAndQuizId(Long userId, Long studentId, Long id, Long quizId);

    void deleteByAssignmentQuizTagId(Long assignmentQuizTagId);

    List<UserAssignmentQuizTag> findAllByAssignmentIdAndStudentIdIn(Long assignmentId,List<Long> studentIds);
}
